package com.bonorsoft.config.properties;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @description
 * @auth WilliamYe
 * @date 2021/8/31
 * @time 15:43
 */
@Component
@PropertySource("classpath:application.yml")
public class WeixinLoginProperties implements InitializingBean {

    @Value("${weixin.login.info.appid}")
    private String appid;

    @Value("${weixin.login.info.appserct}")
    private String appserct;

    @Value("${weixin.login.info.redirectUrl}")
    private String redirectUrl;

    public static String WX_OPEN_APP_ID;
    public static String WX_OPEN_APP_SERCT;
    public static String WX_OPEN_REDIRECT_URL;

    @Override
    public void afterPropertiesSet() throws Exception {
        WX_OPEN_APP_ID = appid;
        WX_OPEN_APP_SERCT = appserct;
        WX_OPEN_REDIRECT_URL = redirectUrl;
    }
}
